<?php declare(strict_types=1);
$api = app('Dingo\Api\Routing\Router');

$apiHandler = function ($api) {
    $api->group(['namespace' => 'App\Api\V2\Controller\Order', "prefix" => "v2/Order"], function ($api) {
        //代理商
        $api->group(["prefix" => "User", "namespace" => "User", 'middleware' => 'user.api'], function ($api) {

            $api->group(["prefix" => "OrderQuery"], function ($api) {
                $api->get("orderQuery", "OrderQueryController@orderQuery");
                $api->get("orderQueryExport", "OrderQueryController@orderQueryExport");
                $api->get("getOrderExportList", "OrderQueryController@getOrderExportList");
                $api->post("OrderExportSaveExportStatus", "OrderQueryController@OrderExportSaveExportStatus");
                $api->get("orderNewQueryExport", "OrderQueryController@orderNewQueryExport");
            });
        });

        //商户
        $api->group(["prefix" => "Merchant", "namespace" => "Merchant", 'middleware' => 'merchant.api'], function ($api) {
            $api->group(["prefix" => "OrderQuery"], function ($api) {
                $api->get("orderQuery", "OrderQueryController@orderQuery");
                $api->get("orderQueryExport", "OrderQueryController@orderQueryExport");
                $api->get("customOrderQuery", "OrderQueryController@customOrderQuery");
                $api->get("getOrderExportList", "OrderQueryController@getOrderExportList");
                $api->post("OrderExportSaveExportStatus", "OrderQueryController@OrderExportSaveExportStatus");
                $api->get("orderNewQueryExport", "OrderQueryController@orderNewQueryExport");
            });
        });
    });
};
$api->version("v1", $apiHandler);